package com.apex.restful.controller;

import com.apex.restful.service.WorkflowRestfulService;
import com.apex.security.api.service.WorkflowServiceApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class WorkflowRestfulController implements WorkflowServiceApi {

    @Autowired
    private WorkflowRestfulService service;

    @Override
    public String getAllDb(@RequestParam("userID") String userId) {
        return service.getAllDB(userId, null);
    }

    @Override
    public String getAllYb(@RequestParam("userID") String userId) {
        return service.getAllYB(userId, null);
    }

    @Override
    public String getAllPageDB(@RequestBody String code) {
        return service.getAllDB(null, code);
    }

    @Override
    public String getAllPageYB(@RequestBody String code) {
        return service.getAllYB(null, code);
    }

    @Override
    public String getUserDbSummary(@RequestParam("userID") String userId) {
        return service.getUserSummary(userId);
    }
}
